package com.rui.study.micro.usermanager;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

@SpringBootApplication
public class UserManagerApp {

    public static void main(String[] args) {

        SpringApplication.run(UserManagerApp.class);
    }

    private static void testMysqlConnection() {
        String url = "jdbc:mysql://study.rui.db:3306/usermanager?characterEncoding=utf8&useSSL=false";
        String username = "yao";
        String password = "YaoWR12#$";

        Connection connection;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            connection = DriverManager.getConnection(url, username, password);
            Statement statement = connection.createStatement();
            statement.execute("SELECT * FROM user_info");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}